#ifndef CIMAGEPROC_H
#define CIMAGEPROC_H
#include <QImage>
#include <list>
#include <map>
#include "cfouriertransform.h"
#include "segmentation.h"
#include "CFilter.h"


class CImageProc
{

public:
    int                  m_FilterWindowSize;
    int                  m_SplotMask;
    int                  m_Brightness;
    int                  m_Contrast;
    CFourierTransform    *m_Fourier;
    CFilter              *m_Filter;
    Segmentation         *m_Segmentation;

private:
    QImage               *m_Data;
    QImage               *m_PrevData;
    std::map<uint, int>  m_HistogramR;
    std::map<uint, int>  m_HistogramG;
    std::map<uint, int>  m_HistogramB;


public:
    CImageProc();
    int     GetImgWidth();
    int     GetImgHeight();
    QImage *GetData() const;
    void    SetData(QImage *Data);
    Segmentation *GetSeg();
    QImage *GetPreviousData();
    void    SetPreviousData();
    QImage *Negative();
    QImage *Brightness(int);
    QImage *Contrast(int);
    QImage *ArithmeticFilter(const QImage&);
    QImage *MedianFilter(const QImage&);
    QImage *Histogram(const QImage&, short);
    QImage *ModifyImgByHistogram(const QImage&, short, int);
    QImage *ModifyImgByHistogramGrayScale(const QImage&, QImage&, int, float);
    QImage *Splot(const QImage&);
    QImage *NonLinearFilter(const QImage& _img, int);
    void    CreateHighPassFilter(Complex**, int, int);
    void    HighPassFilter(float);

private:
    int  GetWindowBordersRangeMin();
    int  GetWindowBordersRangeMax();
    void CountArithmeticColor(const QImage&, int, int, int, int);
    void CountMedianColor(const QImage&, int, int, int, int);
    void InitializeHistogram(std::map<uint, int>&);
    void CountSplot(const QImage&, int, int, int, int);
};

#endif // CIMAGEPROC_H
